﻿
using System;
using System.Linq;
using System.Collections.Generic;

namespace MVVMGrid.UsingReactive.Models
{
    public class ViewSettingsCollectionItem
    {
        public int ID { get; set; }
        public string Description { get; set; }
        public string Link { get; set; }
    }

    public class ViewSettingsCollection
    {
        public int? DefaultViewSettingsID { get; set; }
        public List<ViewSettingsCollectionItem> Items { get; set; }
        public ViewSettingsCollectionItem GetDefaultSettings()
        {
            return
                DefaultViewSettingsID.HasValue
                    ? Items.Where( i => i.ID == DefaultViewSettingsID ).Single()
                    : Items.First();
        }
    }
}
